package com.xz.danhuaapi.common;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xuzhou
 * @version 1.0
 * @createTime 2024-09-27
 * @description 全局限流处理类
 */
@Slf4j
public class CustomGlobalBlockHandler {
    public static BaseResponse<Object> handleBlockException(BlockException blockException) {
        log.error("BlockException ", blockException);
        return ResultUtils.error(ErrorCode.TOO_MANY_REQUESTS_ERROR);
    }
}
